from splinter import Browser

# browser = Browser()
# 指定driver为chrome浏览器
executable_path = {'executable_path':'/snap/chromium/1589/usr/lib/chromium'
                                     '-browser/chrome'}
browser = Browser('chrome', **executable_path)
browser.visit('http://baidu.com')
browser.fill('wd', 'splinter - python acceptance testing for web applications')
button = browser.find_by_xpath('//span[@type="submit"]')
button.click()

if browser.is_text_present('splinter.readthedocs'):
    print ("Yes, the official website was found!")
else:
    print ("No, it wasn't found... We need to improve our SEO techniques")

browser.quit()